(function () {
  // Cor do fundo do titulo das postagens
  var x    = document.getElementById("main").getElementsByTagName("h2"),
      tags = /GERAL|TEMPLATE|GIMP|PHOTOSHOP|BLOGGER|HTML\/CSS/;
    for (i = 0; i < x.length; i++) {
      y = x[i].getAttribute("data-labels");
      if (y) a = y.match(tags);
      if (a) x[i].className += " " + a;
    };

  // Diminui tamanho da fonte para 16px em navegadores como o Opera cuja tamanho padrão é 20px
  var elem = document.getElementsByTagName("body"),
      font = document.defaultView.getComputedStyle(elem[0],null).getPropertyValue("font-size");
  if (font == "20px") elem[0].style.fontSize = ".8em";

  // Gera caixa de códigos
  function getCodes() {
    var getContext = document.getElementsByTagName("code"),
        langCodes = [];

    for (i = 0; i < getContext.length; i += 1) {
      if (getContext[i].getAttribute("data-language")) {
        langCodes.push(getContext[i]);
      }
    }
    return langCodes;
  }

  function getContent(x) {
    var content = x.innerHTML.split("\n");
    var ordList = document.createElement("ol");

    for (i = 0; i < content.length; i += 1) {
      var listItem = "<li><span>" + content[i] + "</span></li>";
      ordList.innerHTML += listItem;
    }
    x.innerHTML = "";
    x.appendChild(ordList);
  }

  var codesCount = getCodes().length;
  for (var j = 0; j < codesCount; j += 1) {
    getContent(getCodes()[j])
  }
})();

window.setTimeout(function(){document.body.className = document.body.className.replace("loading", "");},10);